//
//  CDListTableViewCell.swift
//  DriverSchoolAPP
//
//  Created by Logel on 2017/5/18.
//  Copyright © 2017年 Logel. All rights reserved.
//

import UIKit

class CDListTableViewCell: UITableViewCell {
    @IBOutlet weak var showCD: UIButton!
    @IBOutlet weak var nameLbl: UILabel!
    @IBOutlet weak var addressLbl: UILabel!

    //点击的行数
    var selectNum:Int!
    var delegate:CDListTableViewCellDelegate!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        showCD.layer.borderWidth = 1
        showCD.layer.borderColor = KP_MAIN_BLUE.cgColor
    }
    
    var nb:NearBy!{
        didSet{
            nameLbl.text = nb.name
            addressLbl.text = nb.address
        }
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    @IBAction func toDo(_ sender: UIButton) {
        delegate.editCDListBtnClick(indexPath: selectNum, tag: sender.tag)
    }
    
    


}


protocol CDListTableViewCellDelegate {
    func editCDListBtnClick(indexPath:Int,tag: Int)
}
